<?php
$link= array( 
	'dbms'=>'mysql',
	'localhost'=>'localhost',
	'dbname'=>'root',
	'username'=>'root',
	'pwd'=>'1234',
);	   		
$dsn=$link['dbms'].":host=".$link['localhost'].";dbname=".$link['dbname'];
$dbh = new PDO($dsn, $link['username'], $link['pwd']); //初始化一个PDO对象